<div data-role="header">
    <a href="#myPanel" class="ui-btn ui-icon-grid ui-btn-icon-left">菜单</a>
    <h1>订单详情</h1>
    <a href="javascript:history.back(-1);" class="ui-btn ui-icon-back ui-btn-icon-left">返回</a>
</div>

<style type="text/css">
    .ui-content .ui-grid-b{margin:15px 0;}
    .ui-content .ui-grid-b span{font-size: 16px}
    .ui-content .ui-block-a span{font-weight: bold;}
    .ui-content label{font-weight: bold;}
</style>

<div data-role="main" class="ui-content">
        <div class="ui-grid-b">
            <div class="ui-block-a">
                <span>订单ID：</span>
            </div>
            <div class="ui-block-b|c">
                <span><?=$res['id']?></span>
            </div>
        </div>
        <div class="ui-grid-b">
            <div class="ui-block-a">
                <span>购买项目：</span>
            </div>
            <div class="ui-block-b|c">
                <span><a href="<?=site_url('parameters/show?pid='.$res_par['id'])?>"><?=$res_par['title']?></a></span>
            </div>
        </div>
        <div class="ui-grid-b">
            <div class="ui-block-a">
                <span>项目价格：</span>
            </div>
            <div class="ui-block-b|c">
                <span><?=$res['price']?></span>
            </div>
        </div>
        <div class="ui-grid-b">
            <div class="ui-block-a">
                <span>订单状态：</span>
            </div>
            <div class="ui-block-b|c">
                <span style="color:red"><?=$status[$res['status']]?></span>
            </div>
        </div>
        <div class="ui-grid-b">
            <div class="ui-block-a">
                <span>联系人姓名：</span>
            </div>
            <div class="ui-block-b|c">
                <span><?=$res['user_name']?></span>
            </div>
        </div>
        <div class="ui-grid-b">
            <div class="ui-block-a">
                <span>联系人电话：</span>
            </div>
            <div class="ui-block-b|c">
                <span><?=$res['user_phone']?></span>
            </div>
        </div>
        <?php if($res['status'] == 6): ?>
        <div class="ui-grid-b">
            <div class="ui-block-a">
                <span>退款备注：</span>
            </div>
            <div class="ui-block-b|c">
                <span style="color:red"><?=$res['mess']?></span>
            </div>
        </div>
        <?php endif;?>
        <div class="ui-grid-b">
            <div class="ui-block-a">
                <span>系统备注：</span>
            </div>
        </div>
        <div class="ui-grid-solo" style="margin-bottom: 40px">
            <span><?=$res['remarks']?></span>
        </div>
        <div class="ui-grid-b">
            <div class="ui-block-a">
                <span>用户备注：</span>
            </div>
        </div>
        <div class="ui-grid-solo" style="margin-bottom: 40px">
            <span><?=$res['user_remarks']?></span>
        </div>
        <div>
            <?php if($res['status'] == 4): ?>
            <a href="javascript:;" onclick="signing()" data-role="button">订单签收</a>
            <?php endif;?>
            <?php if($res['status'] == 1): ?>
            <a href="<?=site_url('order/update?oid='.$res['id'])?>" data-role="button">付款</a>
            <?php endif;?>
            <a href="<?=site_url('order/index')?>" data-role="button">返回</a>
        </div>

</div>

<script type="text/javascript">
    //订单处理

    function signing(){

        layer.open({
            content: '该操作不能取消，是否确认签收项目？',
            style:'width:600px',
            btn: ['确认', '取消'],
            shadeClose: false,
            yes: function(){
                layer.open({content: '请稍候...',time: 1});
                 $.post("<?=site_url('order/signing')?>",{oid:<?=$res['id']?>},function(data){
                    if(data > 0){
                        location.reload();
                    }else{
                        layer.open({
                            content: data,
                            style:'width:100%',
                            btn: ['确定']
                        });
                    }
                });
            },
            no: function(){
                layer.open({content: '取消付款', time: 1});
            }
        });
    }
</script>